package cn.wolfcode.trip.base.query;

import cn.wolfcode.trip.base.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author 不出bug- 么么哒
 * @DESCRIPTION
 * @create 2018/11/13
 */

/**
 * 新闻查询条件
 */
@Getter
@Setter
public class NewsQueryObject extends QueryObject {
    /**
     * 新闻类型
     */
    private Integer type = -1;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private Long userId = -1L;

    public Date getEndDate() {
        return DateUtil.getEndDate (endDate);
    }
}
